//
//  FontAndColorMacros.h
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/7/4.
//

#ifndef FontAndColorMacros_h
#define FontAndColorMacros_h

//主题色 导航栏颜色
#define CNavBgColor      [UIColor colorWithHexString:@"00AE68"]
#define CNavBgFontColor  [UIColor colorWithHexString:@"FFFFFF"]

//APP主色
#define CFMainColor [UIColor colorWithHexString:@"56C271"]

//被景色
#define CFTabViewBgColor [UIColor colorWithHexString:@"#F8FAFB"]//原来F3F7FF
//边框颜色(灰)
#define kBorderColor [UIColor colorWithHexString:@"#E3E6ED"]
//分割线
#define CFCellLineColor [UIColor colorWithHexString:@"EBEDF0"]

//页面背景色
#define BGColor [UIColor colorWithRed: 242/255.0 green: 242/255.0 blue: 242/255.0 alpha:1]

//蒙层 颜色（浅黑色）
#define realTimeBlurColor [UIColor colorWithRed: 0/255.0 green: 0/255.0 blue: 0/255.0 alpha: 0.4]

//随机色生成
#define kRandomColor  [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1]
//根据颜色拼成图片
#define  kImageWithColor(s) [UIImage imageWithColor: s]

//主题颜色(蓝色)
#define CMainColorGreen kCOLOR_HEX(@"#405DBE")

//主题颜色(绿色)
#define CMainColorGreen kCOLOR_HEX(@"#05C79D")


//=======================================================//
#pragma mark -- 设置颜色RGB -----
#define  kColorRGBA(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
#define  kColorRGB(r, g, b)   [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
//随机颜色
#define  cCOLOR_RRGBA          (arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))
#pragma mark -rgb颜色转换
//16进制  不用添加 0x
#define  kCOLOR_HEX(color)  [UIColor colorWithHexString:color]
#define  kCOLOR_HEX_A(color,a)  [UIColor colorWithHexString:color alpha:a]
#define  kUIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//字体颜色
#define FontColor(color)  [UIColor colorWithHexString:color]

//十六进制颜色
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]


//=======================================================//
#pragma mark ---  字体区  -------
#define  kLineHeight (1 / [UIScreen mainScreen].scale)
//粗体
#define  kBOLDSYSTEMFONT(FONTSIZE) [UIFont boldSystemFontOfSize:FONTSIZE]
//普通字体
#define  kSYSTEMFONT(FONTSIZE)            [UIFont systemFontOfSize:FONTSIZE]
#define  kFONT(NAME, FONTSIZE)            [UIFont fontWithName:(NAME) size:(FONTSIZE)]
#define  kFont12                         [UIFont systemFontOfSize: 12.0f]
//根据iPhone7宽度 去拉伸字体大小
#define  kSYSIP7FONT(FONTSIZE)            kSYSTEMFONT(kRealValue(FONTSIZE))
#define  kBOLDIP7FONT(FONTSIZE)           kBOLDSYSTEMFONT(kRealValue(FONTSIZE))

//所在地区显示 相应字符串
#define  kLocaliZed(x)    NSLocalizedString(x, nil)
#define  kValidStr(x)     [NHUtils validString: x]

#pragma mark -  拼接字符串
#define kNSStringFormat(format,...) [NSString stringWithFormat:format,##__VA_ARGS__]

//字符串转化
#define  kEmptyStr        @""
#define  kNsstrStr(i)     [NSString stringWithFormat: @"%@", i]
#define  kIntToStr(i)     [NSString stringWithFormat: @"%d", i]
#define  kIntegerToStr(i) [NSString stringWithFormat: @"%ld", i]
#define  kFloatToStr(i)   [NSString stringWithFormat: @"%f", i]

//字符串宽度
#define KStringWidth(string,heightLimit,font) ([string boundingRectWithSize:CGSizeMake(MAXFLOAT, heightLimit) options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size.width)


#endif /* FontAndColorMacros_h */
